#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {

    int n = 0, sum = 0;
    scanf("%d", &n);

    int nums[n][n];

    for (size_t i = 0; i < n; i++)
    {
        memset(nums[i], 0, n);
    }

    for (size_t i = 0; i < n; i++)
    {
        for (size_t k = 0; k < n; k++)
        {
            scanf("%d", &nums[i][k]);
            if(i==k||i+k==n-1){
                sum += nums[i][k];
            }
        }
    }

    printf("%d", sum);

    return 0;
}